The present invention relates generally to data communications within a device or system, and in particular to data communications to and from removable components within the device or system via a serial bus.
Conventional solutions for implementing data communications within electronic devices and systems, where at least some of the components are removable and exchangeable, are aimed at special products and are not general and easy to adapt to other systems. These conventional solutions often require that specialized hardware be added to standard system configurations to support interchangeability of different components. The additional, specialized hardware can include, for example, an additional bus that is used for identifying modules connected to the system, and non-standard, specially designed modules. These features typically increase both production costs and device complexity.
U.K. Patent Application No. 2 195 028 A, published Mar. 23, 1988, discloses an apparatus for testing electrical circuits that includes a controller to which selected interface modules can be connected, to enhance functionality of the apparatus. The controller can interrogate the connected modules to determine both the physical location of each module within the apparatus, and function and character of each module. With this information the controller can appropriately organize its internal routines. However, the disclosed bus structure of the apparatus has a multiplicity of specialized buses including a parallel module identification bus. Furthermore, the necessary size of the module identification bus varies depending on the number of modules that can be connected to the apparatus.
U.S. Pat. No. 5,339,362 to Harris discloses an automotive audio system having a controller housing into which modular signal processing components can be inserted. A controller in the audio system polls all positions within the controller housing to determine which components are installed, and then configures itself via software to provide appropriate control functions. In the polling process the controller uses an 8-line wide SELECT bus as well as a specific POLL line. Furthermore, the patent disclosure suggests that all software routines for modular components that can be inserted into the system are stored in RAM, regardless of whether the corresponding modular components are actually inserted in the system.
Thus, the conventional solutions demonstrated in U.K. Patent Application No. 2 195 028 A and U.S. Pat. No. 5,339,362 require large and/or multiple parallel buses, non-standard configurations and protocols, and large RAM capacity.
In accordance with embodiments of the invention, an electronic device including one or more controllers and one or more slave units is provided with an I2C serial bus connecting the controllers and the slave units. The device further includes a secondary memory containing software drivers for a variety of different types of slave units.
The controller determines which types of slave units are present on the bus by sending, for each type of slave unit represented by a corresponding software driver in the secondary memory, a command via the bus using an address for the type. If the controller subsequently receives an acknowledge signal corresponding to the command, then the controller knows that a slave unit of the type indicated by the address is present on the bus. The controller continues sending commands using different addresses, until either a predetermined number of slave units have acknowledged, or until commands corresponding to all of the slave unit types represented by software drivers stored in the secondary memory have been sent.
A corresponding software driver for each slave unit type present on the bus is loaded from the secondary memory into a RAM easily accessed by the controller. The software drivers can be loaded as they are identified, or can be loaded after all slave unit types present on the bus have been determined. The software drivers are used to initialize the slave units present on the bus and to enable the controller to properly coordinate and implement the device functions. Other serial buses and/or bus standards that support individual addressing and acknowledging can be used instead of the I2C bus.